package practice;
import java.util.Timer;
import java.util.TimerTask;
public class TimerDemo {
    public static void main(String[] args) {
//        Timer timer = new Timer();
//        int interval = 1000;
//        timer.schedule(new TimerTask() {
//            @Override
//            public void run() {
//                System.out.println("快醒醒，你入职啦！");
//            }
//        }, interval, interval);

        Timer timer = new Timer();
        int interval = 1000;
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("快醒醒，你作业没啦！");
            }
        }, interval, interval);
    }
}
